home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / libg_261.zip / libg_261 / libg++ / etc / graph / eGetOpt.cc < prev    next >
C/C++ Source or Header  |  1991-06-28  |  562b  |  44 lines

  1. #pragma implementation
  2. #include "eGetOpt.h"
  3.   
  4. int
  5. eGetOpt :: next_arg (int &i)
  6. {
  7.   int tmp;
  8.   if (0 < sscanf (nargv[optind], "%d", &tmp))
  9.     {
  10.       i = tmp;
  11.       optind++;
  12.       return 1;
  13.     }
  14.   else
  15.     return 0;
  16. }
  17.  
  18. int
  19. eGetOpt :: next_arg (double &d)
  20. {
  21.   double tmp;
  22.   if (0 < sscanf (nargv[optind], "%lf", &tmp))
  23.     {
  24.       d = tmp;
  25.       optind++;
  26.       return 1;
  27.     }
  28.   else
  29.     return 0;
  30. }
  31.  
  32. int
  33. eGetOpt :: next_arg (String &s)
  34. {
  35.   if ('-' != nargv[optind][0])
  36.     {
  37.       s = nargv[optind];
  38.       optind++;
  39.       return 1;
  40.     }
  41.   else
  42.     return 0;
  43. }
  44.